In efforts to come up with a really simple RFID reader I expanded my project to include:
– A LCD screen
– WiFi operation.
– Programmable (writable) “Master Cards”.
Basic thought process.
– Keep minimal python script.
– Program a “master card(s)” using their ID. One card will be a “Add Card” and “Delete Card”. If the ID matches the one in the Python script then allow it to write (or delete) data to a MySQL table “registeredCards”.
– PHP script will lookup “registeredCards” then query the “cardActivity” table.
passwd
sudo su –
raspi-config
cp /usr/share/zoneinfo/America/Edmonton /etc/localtime
apt-get update
apt-get install git python2.7-dev python-smbus ntp
cd ~
git clone https://github.com/lthiery/SPI-Py.git
cd SPI-Py
python setup.py install
cd ~
git clone https://github.com/sourceperl/rpi.lcd-i2c.git
cd rpi.lcd-i2c
python setup.py install
cd ~
git clone https://github.com/pimylifeup/MFRC522-python.git
cd MFRC522-python
#!/usr/bin/env python
import RPi.GPIO as GPIO
import SimpleMFRC522
import RPi_I2C_LCD
from time import *
import mysql.connector
mydb = mysql.connector.connect(
host=”localhost”,
user=”clock”,
passwd=”password”,
database=”clock”
)
mycursor = mydb.cursor()
sql = “INSERT INTO activity (name, number) VALUES (%s, %s)”
lcd = RPi_I2C_LCD.LCD()
lcd.set_backlight(True)
reader = SimpleMFRC522.SimpleMFRC522()
while True:
lcd.clear()
lcd.message(“Ready for card.”)
try:
id, text = reader.read()
print(id)
print(text)
lcd.clear()
lcd.message(text)
val = (text, id)
mycursor.execute(sql, val)
mydb.commit()
sleep(3)
except KeyboardInterrupt:
GPIO.cleanup()
sudo apt-get install apache2 php mariadb-server php-mysql python-mysql.connector
Your article helped me a lot, is there any more related content? Thanks!
Thank you, your article surprised me, there is such an excellent point of view. Thank you for sharing, I learned a lot.
I do not even understand how I ended up here, but I assumed this publish used to be great
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
I’m often to blogging and i really appreciate your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for brand spanking new information.
This was beautiful Admin. Thank you for your reflections.